<template>
  <div class="left">
    <div class="row1">
      <div class="title_name">
        <span>项目概览</span><span class="eng">Project Overview</span>
      </div>
      <div class="bbox">
        <div class="tab_title">招商项目</div>
        <div id="loop"></div>
        <div class="item_box">
          <div class="item_bar1">
            <div class="item_name">招商项目数量</div>
            <div class="item_num">
              <img src="../../public/img/done.png" class="fix_img" />
              <div>已完成</div>
              <div class="fix_name">89</div>
            </div>
          </div>
          <div class="item_bar1">
            <div class="item_name">招商项目数量</div>
            <div class="item_num">
              <img src="../../public/img/doing.png" class="fix_img" />
              <div>已完成</div>
              <div class="fix_name">89</div>
            </div>
          </div>
        </div>
        <div class="tab_title1">招商金额</div>
        <div id="loop1"></div>
        <div class="btm_list">
          <img src="../../public/img/wallet.png" class="img_box" />
          <div class="wa_name">招商金额数</div>
          <div class="wa_namer">
            <span>已完成</span>
            <span class="name_r_num">99</span>
            <span>亿</span>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="right_tab" v-if="invest[0]">
    <img src="../../public/img/4_1_1.png">
    <img src="../../public/img/4_1_2.png" @click="ShowRentalAndSale">
  </div>
  <div class="right_tab" v-if="invest[1]">
    <img src="../../public/img/4_2_1.png">
    <img src="../../public/img/4_2_2.png">
    <img src="../../public/img/4_2_3.png">
  </div>
  <div class="right_tab" v-if="invest[2]">
    <img src="../../public/img/4_3_1.png" @click="ShowCompanyInfo('99')">
    <img src="../../public/img/4_3_2.png">
    <img src="../../public/img/4_3_3.png">
    <img src="../../public/img/4_3_4.png">
    <img src="../../public/img/4_3_5.png">
  </div>
  <div class="right">
    <div class="r_row1">
      <div class="title_name">
        <span>项目详情</span><span class="eng">Project details</span>
      </div>
      <div class="bbox">
        <div class="tab_title">项目阶段</div>
        <div class="bimg_box">
          <div class="little_box">
            <img src="../../public/img/pre.png" class="tittle_img" />
            <div class="tittle_name">前期</div>
          </div>
          <div class="little_box">
            <img src="../../public/img/pre1.png" class="tittle_img" />
            <div class="tittle_name">待签</div>
          </div>
          <div class="little_box">
            <img src="../../public/img/pre2.png" class="tittle_img" />
            <div class="tittle_name">已签约</div>
          </div>
        </div>
        <div class="tab_title">项目开始时间</div>
        <div class="bimg_box">
          <div class="little_box">
            <img src="../../public/img/year.png" class="tittle_img1" />
            <div class="tittle_name">年度</div>
          </div>
          <div class="little_box">
            <img src="../../public/img/jidu.png" class="tittle_img1" />
            <div class="tittle_name">季度</div>
          </div>
          <div class="little_box">
            <img src="../../public/img/mon.png" class="tittle_img1" />
            <div class="tittle_name">月季</div>
          </div>
        </div>
        <div class="table_box">
          <div class="table_head">
            <div class="table_name">项目名称</div>
            <div class="table_name">项目阶段</div>
            <div class="table_name">项目开始时间</div>
          </div>
          <div class="table_body">
            <div class="body_box" v-for="(item,index) in tablist" :key="index">
              <div class="body_name">{{item.name}}</div>
              <div class="body_status">{{item.status}}</div>
              <div class="body_time">{{item.time}}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts';
import { getLoop5, getLoop6 } from "@/utils/getecharts"
export default {
  data() {
    return {
        tablist:[
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"},
          {name:"招商银行",status:"前期沟通",time:"2020-01-10"}
        ],
        invest:this.$store.state.invest,
        invest2:this.$store.state.invest2,
        invest3:this.$store.state.invest3,
    }
  },
   watch:{
    "$store.state.invest": {
      handler: function (newValue, oldValue) {
        this.invest = newValue
      },
    }
  },
  methods: {
    ShowRentalAndSale:function(){
      console.log("ShowRentalAndSale")
      document.getElementById('iframe').contentWindow.ShowRentalAndSale();
    },
    ShowCompanyInfo:function(Type){
      console.log("ShowCompanyInfo",Type)
      document.getElementById('iframe').contentWindow.ShowCompanyInfo({Type:Type});
    }
  },
  mounted() {
    echarts.init(document.getElementById("loop")).dispose()
    var myChart = echarts.init(document.getElementById('loop'));
    getLoop5(myChart)
    echarts.init(document.getElementById("loop1")).dispose()
    var myChart = echarts.init(document.getElementById('loop1'));
    getLoop6(myChart)
  }
}
</script>

<style scoped>
.row1 {
  width: 407px;
  height: 902px;
  background: url("../../public/img/longtitle.png") no-repeat;
  background-size: cover;
  z-index: -1;
  margin-left: 30px;
}
.r_row1 {
  width: 407px;
  height: 902px;
  background: url("../../public/img/longtitle.png") no-repeat;
  background-size: cover;
  z-index: -1;
}
.title_name {
  width: 100%;
  height: 50px;
  font-size: 22px;
  color: white;
  font-weight: bolder;
  box-sizing: border-box;
  padding: 10px 10px 10px 20px;

  z-index: 5;
}
.eng {
  font-size: 14px;
  margin-left: 10px;
}
.tab_title {
  width: 131px;
  height: 20px;
  color: white;
  font-size: 14px;
  background: url("../../public/img/s_title.png") no-repeat;
  background-size: cover;
  box-sizing: border-box;
  line-height: 10px;
  padding-left: 10px;
  margin-left: 10px;
  margin-top: 20px;
}
.tab_title1 {
  width: 131px;
  height: 20px;
  color: white;
  font-size: 14px;
  background: url("../../public/img/s_title.png") no-repeat;
  background-size: cover;
  box-sizing: border-box;
  line-height: 10px;
  padding-left: 10px;
  margin-left: 10px;
  margin-top: 80px;
}
#loop {
  margin-left: 40px;
  margin-top: 40px;
  width: 307px;
  height: 189px;
}
#loop1 {
  margin-left: 40px;
  margin-top: 40px;
  width: 307px;
  height: 189px;
}
.item_box {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}
.item_bar1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}
.item_name {
  font-size: 14px;
  color: rgba(202, 215, 218, 1);
  margin-left: -60px;
}
.item_num {
  margin-top: 5px;
  width: 142px;
  height: 48px;
  background: url("../../public/img/num2.png") no-repeat;
  background-size: cover;
  text-align: center;
  align-items: center;
  font-size: 16px;
  color: white;
  display: flex;
}
.fix_name {
  font-size: 24px;
  line-height: 48px;
  color: rgba(20, 255, 223, 1);
  margin-left: 10px;
}
.fix_img {
  width: 23px;
  height: 23px;
  margin-left: 20px;
}
.img_box {
  width: 28px;
  height: 31px;
}
.btm_list {
  height: 31px;
  display: flex;
  align-items: center;
  font-size: 18px;
  color: white;
  box-sizing: border-box;
  padding: 0 40px;
  margin-top: 50px;
}
.wa_name {
  margin-left: 10px;
}
.wa_namer {
  margin-left: 40px;
  margin-top: -8px;
}
.name_r_num {
  font-size: 26px;
  margin: 0 5px;
}
.right {
  position: absolute;
  right: 30px;
  top: 110px;
}
.bimg_box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 30px;
}
.little_box {
  display: flex;
  align-items: center;
}
.tittle_img {
  width: 34px;
  height: 37px;
}
.tittle_img1 {
  width: 49px;
  height: 25px;
  margin-right: -10px;
}
.tittle_name {
  font-size: 18px;
  color: white;
}
.table_head{
  width: 345px;
  height: 34px;
  background: url("../../public/img/table_head.png") no-repeat;
  background-size: cover;
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 40px;
  color: white;
  font-size: 14px;
}
.table_box{
  display: flex;
  flex-direction: column;
  align-items: center;
}
.body_box{
  display: flex;
  justify-content: space-around;
  width: 345px;
  color: white;
  margin-top: 20px;
  font-size: 13px;
}
.right_tab{
  position: absolute;
  right: 480px;
  top: 500px;
  width: 168px;
  height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  /* border: 1px solid black; */
}
.right_tab>img{
  width: 150px;
  height: 48px;
  margin-top: 20px;
}
</style>